package com.springcloud.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.springcloud.consumer.domain.User;
import com.springcloud.consumer.service.HelloService;

@RestController
public class ConsumerController {
	
	@Value("${server.port}")
	String port;

	@Autowired
	HelloService helloservice;
	
	@GetMapping("/ribbon-consumer")
	public String helloConsumer(){
		System.out.println("into port ==" +port);
		return helloservice.helloService();
	}
	
	@GetMapping("/getuser")
	public User getUser(){
		return helloservice.getUserfromId(1);
	}
	
}
 